package cn.stylefeng.guns.modular.business.model.result;

import cn.stylefeng.guns.core.CardStatusState;
import lombok.Data;
import java.util.Date;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 * 卡号
 * </p>
 *
 * @author jwj
 * @since 2019-07-12
 */
@Data
public class CardResult implements Serializable {

    private static final long serialVersionUID = 1L;


    private Integer cardId;

    /**
     * 卡号
     */
    private String cardNo;

    /**
     * 卡密
     */
    private String cardPassword;

    /**
     * 卡号状态，0已入库，待销售，1已销售
     */
    private Integer cardStatus;

    private String cardStatusName;

    /**
     * 提交申请卡号的用户名
     */
    private String createUser;

    /**
     * 提交申请卡号的用户id
     */
    private Long createUserId;

    /**
     * 面值
     */
    private BigDecimal quota;

    /**
     * 回收价格
     */
    private BigDecimal amount;

    /**
     * 回收费率
     */
    private BigDecimal recoverRate;

    /**
     * 成本费率
     */
    private BigDecimal costRate;

    /**
     * 成本价格
     */
    private BigDecimal costAmount;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    private String createTimeStr;

    private String updateTimeStr;

    /**
     * 是否删除
     */
    private Integer deleteFlag;

    /**
     * 订单Id
     */
    private Integer orderId;

    private String orderNo;

    /**
     * 分类
     */
    private String cardCataoryName;

    /**
     * 分类Id
     */
    private Long cardCataoryId;

    public void setCardStatus(Integer cardStatus) {
        if (cardStatus.equals(CardStatusState.add_storage.getCode())) {
            this.cardStatusName = CardStatusState.add_storage.getMessage();
        } else {
            this.cardStatusName = CardStatusState.selled.getMessage();
        }
        this.cardStatus = cardStatus;
    }
}
